#include <kutils.h>
#include "display.h"
#include "memory.h"
#include "syscall.h"
#include "apm.h"

void power_state_handler(syscall_regs_t *r);

void power_state_handler(syscall_regs_t *r)
{
	switch(r->arg1)
	{
		case 1:
			r->success = 0;
			apm_reboot();
			break;
		case 2:
			r->success = 0;
			apm_shutdown();
			break;
		default:
			r->success = 0;
			break;
	}
}

void init_apm_interface(void)
{
	install_syscall(SYS_POWER_STATE, power_state_handler);
}
